<?php
include_once("../config.php");
$u = $_GET['uname'];
$u = str_ireplace($search, '', $u);

$sql = "select user.juese as juese,user.ming as ming,user.tel as tel,danwei.name as dwname,
		user.id as id from user 
		left join danwei on user.danwei=danwei.id 
		where user.username ='$u' or user.tel = '$u'";
$requ=mysqli_query($con,$sql);
$js=array("无权限","报修者","管理员","工程师");
if($requ){
	$rs= mysqli_fetch_array($requ);
	if($rs){
		$result='{"status":"1","msg":"ok","js":"'.$js[$rs['juese']].'","id":"'.$rs['id'].'","zt":"'.$rs['juese'].'",
		"ming":"'.$rs['ming'].'","tel":"'.$rs['tel'].'","dw":"'.$rs['dwname'].'"}';
	}else{
		$result = '{"status":"-1","msg":"无记录。请重试或联系管理员创建账户。"}';
	}
}else{
	$result = '{"status":"-2","msg":"查询错误"}';
}
echo $result;









